package my.test.hencodertest;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by 丁旭 on 2017/10/27.
 */

public class MyTestView extends View {
    public MyTestView(Context context) {
        super(context);
    }

    public MyTestView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public MyTestView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint.setColor(Color.BLACK);
        RectF rect1 = new RectF(200, 200, 400, 400);
        Path path = new Path();
        path.addArc(rect1, -225, 225);
        RectF rect2 = new RectF(400, 200, 600, 400);
        path.arcTo(rect2, -180, 225, false);
        path.lineTo(400, 542);

        //canvas.drawArc(rect, 0, 100, true, paint);
    }
}
